﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace PotentialRentals.Models
{
    public class Address
    {
        [Key]
        public int AddressId { get; set; }

        [StringLength(50)]
        [Display(Name = "Address Name: ")]
        public string Name { get; set; }

        [Required]
        [StringLength(50)]
        [Display(Name = "*Street: ")]
        public string Street { get; set; }

        [Required]
        [StringLength(50)]
        [Display(Name = "*City: ")]
        public string City { get; set; }

        [Display(Name = "State: ")]
        public virtual State State { get; set; }

        [Display(Name = "Zip: ")]
        public int Zip { get; set; }

        [Required]
        public float Lat { get; set; }
        
        [Required]
        public float Lng { get; set; }

        [Display(Name = "Address Amenities: ")]
        public virtual ICollection<AddressAmenity> Amenities { get; set; }

        public virtual ICollection<Rental> Rentals { get; set; }

        public Address()
        {
            Amenities = new List<AddressAmenity>();
        }
    }
}